package com.mini.es.service;

import com.mini.es.model.EsBusinessStudentOrderInfo;
import com.mini.vo.MemberDataCondition;
import com.mini.vo.MemberDataVO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

/**
 * @author anjl
 * @date 2021/2/26
 **/
public interface EsBusinessStudentOrderInfoService {

    Iterable<EsBusinessStudentOrderInfo> save(List<EsBusinessStudentOrderInfo> list);

    EsBusinessStudentOrderInfo findById(String miniOrderNo);
    /**
     * 根据ids查询全部订单信息
     * @param ids
     * @return
     */
    List<EsBusinessStudentOrderInfo> findAllById(List<String> ids);

    /**
     * 根据updateTime获取最新的数据
     */
    EsBusinessStudentOrderInfo findLatestUpdateTimeData();

    /**
     * 根据组、运营专员进行分组统计
     */
    List<MemberDataVO> summaryDataByUser(MemberDataCondition condition);
    /**
     * 根据attachupdateTime获取最新的数据
     */
    EsBusinessStudentOrderInfo findLatestAttachUpdateTimeData();
    /**
     * 根据teacherupdateTime获取最新的数据
     */
    EsBusinessStudentOrderInfo findLatestTeacherUpdateTimeData();

    /**
     * 根据baseupdateTime获取最新的数据
     * @return
     */
    EsBusinessStudentOrderInfo findLatestBaseUpdateTimeData();

    /**
     * 根据classUpdateTime获取最新的数据
     */
    EsBusinessStudentOrderInfo findLatestClassUpdateTimeData();

    /**
     * 根据运营专员分组查询teacherupdateTime是否全部相同

    Map<Integer, List<Date>> groupByTeacher();*/

    /**
     * 查询订单中teacher信息不一致的数据
     */
    Page<EsBusinessStudentOrderInfo> pageByTeacherId(Integer teacherId, Date teacherUpdateTime, Pageable pageable);

    Page<EsBusinessStudentOrderInfo> pageByMiniLessonId(Long miniLessonId, Date baseUpdateTime, Pageable pageable);

    /**
     * 查询order条目数
     */
    Integer countByOrderPayTimeBetween(Date startTime, Date time);

    Integer countByMysqlUpdateTimeBetween(Date date, Date now);

    /**
     * 分页查询
     */
    Page<EsBusinessStudentOrderInfo> page(Date startTime, Date time, Pageable pageable);

    Page<EsBusinessStudentOrderInfo> pageBetweenMysqlUpdateTime(Date date, Date now, Pageable pageable);

    /**
     * 删除
     */
    void deleteAll(List<EsBusinessStudentOrderInfo> list);



}
